#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:6031)
void merge(int* nums1, int nums1Size, int m, int* nums2, int nums2Size, int n) {
    int temp[nums1Size];
    int p1 = 0, p2 = 0;
    int cur = 0;
    while (p1 < m || p2 < n)
    {
        if (p1 == m)
        {
            temp[cur++] = nums2[p2++];
        }
        else if (p2 == n)
        {
            temp[cur++] = nums1[p1++];
        }
        else if (nums1[p1] <= nums2[p2])
        {
            temp[cur++] = nums1[p1++];
        }
        else
        {
            temp[cur++] = nums2[p2++];
        }
    }
    for (int i = 0; i < m + n; i++)
    {
        nums1[i] = temp[i];
    }
}